package com.fh.common.util;

import java.io.Closeable;
import java.io.IOException;

/**
 * @author Qiu,Junda
 * @date 2019年4月9日
 * @description
 */
public class IOUtils {

	private IOUtils() {
		throw new AssertionError();
	}

	public static void close(Closeable closeable) {
		if (closeable != null) {
			try {
				closeable.close();
			} catch (IOException e) {
				throw new RuntimeException("IOException occurred. ", e);
			}
		}
	}

	public static void closeQuietly(Closeable closeable) {
		if (closeable != null) {
			try {
				closeable.close();
			} catch (IOException e) {
				// Ignored
			}
		}
	}
}
